import co
import time
import 'mod.n'

fn boom() {
    var start = time.now().ms_timestamp()
    for int i = 0; i < 5; i+=1 {
        co.sleep(500)
    }

    mod.count += 1
}

fn main() {
    var start = time.now().ms_timestamp()
    for int i = 0; i < 200000; i+=1 {
        go boom()
    }

    println('co create end, use time =', time.now().ms_timestamp() - start)
    for int i = 0; i < 50; i+=1 {
        co.sleep(100)
        println('user_time(ms)=', time.now().ms_timestamp() - start, 'completed_count=',  mod.count)
    }

    println('main_co done')
}